import 'package:get/get.dart';

class PracticeController extends GetxController {
  var words = <String>[].obs;
  var selectedUnit = '第一单元'.obs;
  var results = <String, List<String>>{}.obs;

  void loadWords() {
    words.value = ['你', '好', '世', '界'];
  }

  void recordResult(String word, bool isCorrect) {
    if (!isCorrect) {
      results[selectedUnit.value] ??= [];
      results[selectedUnit.value]!.add(word);
    }
  }
}